/**
 * Created with IntelliJ IDEA.
 * Description: 求数组的平均值
 * Author:  LiuTao
 * Version: 1.0
 * Date:    2023-04-27  18:56
 */
public class Test {
    public static double avg(int[] array) {
        int sum = 0;
        for (int i = 0; i < array.length; i++) {
            sum += array[i];
        }
        return sum/ array.length;
    }
    public static void main(String[] args) {
        int[] array = new int[]{1,2,3,4,5};
        System.out.println(avg(array));
    }
}
